import { IsNumber, IsBoolean, IsOptional } from 'class-validator';

// 添加/更新用户歌曲关系的DTO
export class UserSongDto {
  @IsNumber()
  songId: number;

  @IsBoolean()
  @IsOptional()
  isFavorite?: boolean = false;
}

// 用户歌曲关系的响应DTO
export class UserSongResponseDto {
  id: number;
  songId: number;
  isFavorite: boolean;
  playCount: number;
  addedAt: Date;
  updatedAt: Date;
  lastPlayedAt?: Date;
  song: {
    id: number;
    title: string;
    artist: {
      id: number;
      name: string;
    };
    album: {
      id: number;
      title: string;
    };
    duration: number;
    coverImageUrl?: string;
    audioUrl: string;
  };
}

// 用户音乐统计信息DTO
export class UserMusicStatsDto {
  totalFavorites: number;
  totalPlays: number;
  recentlyPlayed: {
    songId: number;
    title: string;
    artist: {
      id: number;
      name: string;
    };
    playedAt: Date;
  }[];
}
